package com.k9sv.service.impl;

import java.io.Serializable;
import java.util.List;

import com.k9sv.dao.IBaseDao;
import com.k9sv.service.IBaseManager;

public class BaseManager implements IBaseManager {

	protected IBaseDao baseDao;
	@Override
	public <T> T save(T paramT) throws Exception {
		return baseDao.save(paramT);
	}

	@Override
	public <T> T getByClassId(Class<? extends T> clazz, Serializable id)
			throws Exception {
		return baseDao.getByClassId(clazz, id);
	}

	@Override
	public <T> void delete(T entity) throws Exception {
		baseDao.delete(entity);
	}

	@Override
	public <T> void merge(T entity) throws Exception {
		baseDao.merge(entity);

	}

	@Override
	public <T> void update(T entity) throws Exception {
		baseDao.update(entity);

	}

	@Override
	public <T> List<T> query(String query, Object[] values, int start, int size)
			throws Exception {
		return baseDao.query(query, values, start, size);
	}

	@Override
	public Object getCount(String where, Object[] values) throws Exception {

		return baseDao.getCount(where, values);
	}

	public IBaseDao getBaseDao() {
		return baseDao;
	}

	public void setBaseDao(IBaseDao baseDao) {
		this.baseDao = baseDao;
	}

}
